From 55e449417497a841cb4a31690bbe58c4cb3c3cf3 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 4 May 2024 11:53:36 -0600 Subject: [PATCH] clang-tidy modernize-loop-convert (#1275) --- duplicate.cc | 3 +-- shape.cc | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/duplicate.cc b/duplicate.cc index 552b23faf..32378b319 100644 --- a/duplicate.cc +++ b/duplicate.cc @@ -73,8 +73,7 @@ void DuplicateFilter::process() wptfirst->latitude = wptlast->latitude; wptfirst->longitude = wptlast->longitude; } - for (auto it = values.cbegin(); it != values.cend(); ++it) { - Waypoint* wpt = *it; + for (Waypoint* wpt : values) { if (purge_duplicates || (wpt != wptfirst)) { wpt->wpt_flags.marked_for_deletion = 1; } diff --git a/shape.cc b/shape.cc index 42cbe1e57..19af063af 100644 --- a/shape.cc +++ b/shape.cc @@ -220,15 +220,15 @@ ShapeFormat::read() nameidx = -2; const QStringList opt_name_fields = qopt_name.split('+', Qt::SkipEmptyParts); nameindices.reserve(opt_name_fields.size()); - for (int oidx=0; oidx